<!-- Test harness for the OpenSAM Single Sign On Java module.
     This code is used to test OpenSAM_SSO.java

     Copyright for this snippet of code: none.
-->
<%@ page import = "java.net.*" %>
<%@ page import = "org.apache.commons.httpclient.*" %>
<%@ page import = "org.opensam.sso.*" %>

<HTML><HEAD><TITLE>OpenSAM SSO test harness</TITLE></HEAD>
<BODY>
<% 
      OpenSAM_SSO sso = new OpenSAM_SSO();
      out.println("calling sso.authenticate()...<br>");

      int auth_result = -9; // simple test value meaning "none yet".

// ALLOW exceptions to pop to the top so that Jakarta reports the full
// stack for us. Only for testing!

//try {
      auth_result = sso.authenticate( request.getParameterMap() );
//} catch( ConnectException cf_exc ) {
//	out.println("ConnectException: " + cf_exc);
//} catch( Exception exc ) {
//	out.println("Exception: " + exc);
//} 
    if( auth_result == OpenSAM_SSO.resultSUCCESS ) {
      out.println( "Login SUCCEEDED.");
      out.println( "<br>OUT_StorageServerUrl:"+ sso.OUT_StorageServerUrl);
      out.println( "<br>OUT_StorageUserName:" + sso.OUT_StorageUserName);
      out.println( "<br>OUT_StorageSessionId:"+ sso.OUT_StorageSessionId);
      out.println( "<br>OUT_StoragePassword:" + sso.OUT_StoragePassword);
      out.println( "<br>OUT_determinedWebDAVUrlParameters:"  + sso.OUT_determinedWebDAVUrlParameters);
      out.println( "<br>OUT_determinedStorageDomainAndPath:" + sso.OUT_determinedStorageDomainAndPath);
    }
    else {
      out.println( "Login failed, result code: "+auth_result+", Err msg: "+
	sso.get_errorMessage() );
    }
%>
</BODY>
</HTML>
